﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:ImageStackLib="using:EString.ImageStack" mc:Ignorable="d"
	x:Class="EString.ImageStack.LightBoardElement"
	d:DesignWidth="260" d:DesignHeight="253"  Background="#00000000" >
    <UserControl.Resources>
        <ResourceDictionary>

            
            <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"/>
            </ItemsPanelTemplate>


        </ResourceDictionary>

    </UserControl.Resources>

    <Border x:Name="border" RenderTransformOrigin="0.5,0.5" BorderBrush="Transparent" BorderThickness="4" CornerRadius="1" VerticalAlignment="Top" 
             >
        <Border.RenderTransform>
            <CompositeTransform/>
        </Border.RenderTransform>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:0.3" To="MouseOver">
                        <VisualTransition.GeneratedEasingFunction>
                            <ExponentialEase EasingMode="EaseOut"/>
                        </VisualTransition.GeneratedEasingFunction>
                    </VisualTransition>
                    <VisualTransition From="MouseOver" GeneratedDuration="0:0:0.1">
                        <VisualTransition.GeneratedEasingFunction>
                            <ExponentialEase EasingMode="EaseOut"/>
                        </VisualTransition.GeneratedEasingFunction>
                    </VisualTransition>
                	<VisualTransition GeneratedDuration="0:0:0.3"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="MouseOver">
                    <Storyboard>
                		<DoubleAnimation Duration="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="mainGrid" d:IsOptimized="True" To="1.15"/>
                		<DoubleAnimation Duration="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="mainGrid" d:IsOptimized="True" To="1.15"/>
                	</Storyboard>
                </VisualState>
                <VisualState x:Name="Normal"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <Grid x:Name="LayoutRoot" >



            <StackPanel Orientation="Vertical">
                
                <ImageStackLib:LineControl2 />
                
<Grid x:Name="mainGrid"   RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,12,0,0">
	<Grid.RenderTransform>
		<CompositeTransform/>
	</Grid.RenderTransform>
                    <Grid.RowDefinitions>
                    	<RowDefinition Height="Auto"/>
                    	<RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <Border x:Name="border1" Margin="3" Grid.Row="1" BorderThickness="4" Padding="4">
                        <Border.Background>
                            <LinearGradientBrush >
                                <GradientStop Color="#FF6C6C6C" Offset="0"/>
                                <GradientStop Color="#FF4E4E4E" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                        <Grid >
                            <!--<ImageTiler1:BmpTiler TileImageSource="checkerbakSmall.png"/>-->



                        </Grid>
                    </Border>
                    <StackPanel Orientation="Horizontal" Margin="3" VerticalAlignment="Center">
                    	<TextBlock Text="{Binding TypeName}" Foreground="White" FontFamily="Palatino Linotype" />
                        <TextBlock Text="{Binding ElementType}"  FontFamily="Palatino Linotype"/>
                    </StackPanel>
                    <Image Source="{Binding Visual}"  Stretch="None" HorizontalAlignment="Center" Grid.Row="1" Margin="20,15" VerticalAlignment="Center"/>
                    <Rectangle Opacity="0.56" Height="25" VerticalAlignment="Center" Margin="-2,-2,-2,0" IsHitTestVisible="False" Visibility="Collapsed">
                        <Rectangle.Fill>
                            <LinearGradientBrush EndPoint="0.538,0.09" MappingMode="RelativeToBoundingBox" StartPoint="0.539,1.39">
                                <GradientStop Color="#79FFFFFF" Offset="0.722"/>
                                <GradientStop Color="Transparent" Offset="0.346"/>
                                <GradientStop Color="#64FFFFFF" Offset="0.667"/>
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <Button x:ConnectionId='1' x:Name="button" Content="" 
                            HorizontalAlignment="Stretch" Opacity="0.28" 
                            VerticalAlignment="Stretch" Grid.RowSpan="2" 
                                                   
                                                                     
                                                                                                           
                            BorderBrush="{x:Null}"/>

                </Grid>

                <ItemsControl ItemsSource="{Binding Children}" ItemsPanel="{StaticResource ItemsPanelTemplate1}" VerticalAlignment="Top" HorizontalAlignment="Center">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <ImageStackLib:LightBoardElement HorizontalAlignment="Left" VerticalAlignment="Top"/>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>

            </StackPanel>



        </Grid>
    </Border>
</UserControl>

